<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMobileRechargeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mobile_recharge', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title',100)->comment('标题');
            $table->string('image',250)->default('')->comment('图片地址');
            $table->unsignedDecimal('discount')->default(1)->comment('折扣');
            $table->unsignedDecimal('max_amount')->default(0)->comment('最大充值额');
            $table->unsignedDecimal('min_amount')->default(0)->comment('最小充值额');
            $table->unsignedTinyInteger('only_first')->default(0)->comment('1表示新人专享');
            $table->unsignedInteger('months')->default(3)->comment('返回月数');
            $table->tinyInteger('can_use_coupon')->default(0)->comment('是否允许使用优惠券');
            $table->string('tag',100)->default('')->comment('人气套餐标签');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('mobile_recharge');
    }
}
